﻿<UserControl x:Class="Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Views.Controls.ToolBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:fidely="clr-namespace:Fidely.Framework.Integration.WPF;assembly=Fidely.Framework.Integration.WPF"
             mc:Ignorable="d" 
             d:DesignHeight="30" d:DesignWidth="500">
    <DockPanel>
        <DockPanel.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <GradientStop Color="#FAFAFA" Offset="0.35"/>
                <GradientStop Color="#E0E0E0" Offset="0.95"/>
                <GradientStop Color="#EEEEEE" Offset="1"/>
            </LinearGradientBrush>
        </DockPanel.Background>
        <Menu DockPanel.Dock="Left" Background="Transparent" VerticalAlignment="Center">
            <MenuItem ToolTip="Back" Padding="5,5" Command="{Binding BackHistoryCommand}">
                <MenuItem.Header>
                    <Image Height="16" Width="16">
                        <Image.Style>
                            <Style TargetType="Image">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                        <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Back.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                        <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Back_Disabled.png"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Image.Style>
                    </Image>
                </MenuItem.Header>
            </MenuItem>
            <MenuItem ToolTip="Forward" Padding="5,5" Command="{Binding ForwardHistoryCommand}">
                <MenuItem.Header>
                    <Image Height="16" Width="16">
                        <Image.Style>
                            <Style TargetType="Image">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}, AncestorLevel=1}, Path=IsEnabled}" Value="True">
                                        <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Forward.png"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                        <Setter Property="Source" Value="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Forward_Disabled.png"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Image.Style>
                    </Image>
                </MenuItem.Header>
            </MenuItem>
        </Menu>
        <Menu DockPanel.Dock="Right" Background="Transparent" VerticalAlignment="Center">
            <MenuItem ToolTip="Tools" Padding="5,5">
                <MenuItem.Header>
                    <Image Source="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Tools.png" Height="16" Width="16"/>
                </MenuItem.Header>
                <MenuItem Header="Export" Command="{Binding ExportReportCommand}">
                    <MenuItem.Icon>
                        <Image Source="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Export.png" Height="16" Width="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="How to search ?" Command="{Binding GoToHowToSearchPageCommand}">
                    <MenuItem.Icon>
                        <Image Source="pack://application:,,,/Sasa.QualityTools.CodeAnalysis.FxCopIntegrator;component/Resources/Help.png" Height="16" Width="16"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
        </Menu>
        <Border Margin="3" Background="White" CornerRadius="5" BorderThickness="1" BorderBrush="LightGray" HorizontalAlignment="Stretch" VerticalAlignment="Center">
            <fidely:AutoCompleteBox SearchCommand="{Binding SearchCommand}" AutoCompleteItems="{Binding AutoCompleteItems}"  MatchingMode="{Binding Preferences.MatchingMode}" ToolTip="Search">
                <fidely:AutoCompleteBox.Resources>
                    <Style TargetType="TextBox">
                        <Setter Property="BorderBrush" Value="Transparent"/>
                        <Setter Property="Margin" Value="1"/>
                    </Style>
                </fidely:AutoCompleteBox.Resources>
            </fidely:AutoCompleteBox>
        </Border>
    </DockPanel>
</UserControl>
